# -*- coding: utf-8 -*-

# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html

import time

class DemobaiduPipeline(object):
    def process_item(self, item, spider): 
        now = time.strftime('%Y-%m-%d', time.localtime())
        fileName = 'book_' + now + '.txt'
        print(type(item['html'].encode('utf8')))
        #with open(fileName, 'a') as fp:
        #    fp.write(item['html'].encode('utf8') + '\n\n')
        return item
